/**
 * Created by fanyunlei on 14-9-4.
 */
function close_div(){
    $("#close_div").css("display","none");
}
function open_div(){
    $("#close_div").css("display","");
}

function edit_password(){
     old_pwd=$("#old_pwd").val().toString();
     new_pwd=$("#new_pwd").val().toString();
     confirm_pwd=$("#confirm_pwd").val().toString();
     if (old_pwd==""){
         $.messager.alert("确定",'原密码不能为空！',"error");
         return false;
     }
     if (new_pwd==""){
         $.messager.alert("确定",'新密码不能为空！',"error");
         return false;
     }
     if (confirm_pwd==""){
         $.messager.alert("确定",'确认密码不能为空！',"error");
         return false;
     }
    if (confirm_pwd !=new_pwd){
         $.messager.alert("确定",'新密码与确认密码不同，请重新设置！',"error");
         return false;
     }

	 $.post( "/modify_pwd",
        {
            old_pwd:old_pwd,
            new_pwd:new_pwd
        }
        ,function (data){
            if ("1"==data){
               $("#close_div").css("display","none");
               $.messager.alert("确定","密码修改成功，请牢记新密码！","");
               $("#old_pwd").val("");
               $("#new_pwd").val("");
               $("#confirm_pwd").val("");
            }else{
					$.messager.alert("确定","密码修改错误，请确认原始密码是否正确！","error");
            }
    });

}

